//go:build ignore
// +build ignore

package main

import (
	"database/sql"
	"fmt"
)

func TestImprovedSyntax(db *sql.DB) {
	// 测试1: 文本插入 - 应该自动导入fmt
	tableName := "users"
	query1 := Query(`SELECT count(*) FROM {tableName}`)

	// 测试2: 简化的嵌套语法 - 使用Q()简写
	role := "admin"
	query2 := Query(`
		SELECT * FROM users WHERE id IN (
			{
				Q('SELECT user_id FROM permissions WHERE role = #{role}')
			}
		)
	`)

	// 测试3: 更复杂的嵌套 - 混合使用
	status := "active"
	dept := "engineering"
	query3 := Query(`
		SELECT u.name, u.email 
		FROM users u 
		WHERE u.status = #{status}
		AND u.department_id IN (
			{
				Q('SELECT id FROM departments WHERE name = #{dept}')
			}
		)
		AND u.id NOT IN (
			{
				Q('SELECT user_id FROM temporary_blocks WHERE active = #{true}')
			}
		)
	`)

	fmt.Println("Query 1:", query1.String())
	fmt.Println("Query 2:", query2.String())
	fmt.Println("Query 3:", query3.String())
}

func main() {
	TestImprovedSyntax(nil)
}
